package com.meiyou.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.meiyou.mapper.BgadminMapper;
import com.meiyou.mapper.UserMapperCustom;
import com.meiyou.pojo.Bgadmin;
import com.meiyou.pojo.BgadminExample;
import com.meiyou.pojo.BgadminExample.Criteria;
import com.meiyou.pojo.vo.UserVo;
import com.meiyou.service.BgadminService;

@Service("BgAdminService")
public class BgadminServiceImpl implements BgadminService {

	
	@Autowired
	BgadminMapper bgadminMapper;
	@Autowired
	UserMapperCustom userMapperCustom;
	
	public int insertAdmin(Bgadmin bgadmin) {
		// TODO Auto-generated method stub
		
		return bgadminMapper.insert(bgadmin);
	}

	
	public List<Bgadmin> login(Bgadmin bgadmin) {
		// TODO Auto-generated method stub
		BgadminExample bgadminExample = new BgadminExample();
		Criteria criteria = bgadminExample.createCriteria();
		criteria.andACountEqualTo(bgadmin.getaCount());
		criteria.andAPwdEqualTo(bgadmin.getaPwd());
		List<Bgadmin> list = bgadminMapper.selectByExample(bgadminExample);
		return list;
	}

	
	public List<UserVo> selectAllInfo(UserVo userVo) { 
		// TODO Auto-generated method stub
		return userMapperCustom.selectAllInfo(userVo);
	}
}
